<template>
  <el-dialog
      title="查看"
      :visible.sync="open" top="0"
      width="800px"
      append-to-body
      @close="resetForm"
  >
    <!--    {{JSON.stringify(form,null,4)}}-->
    <div class="dialog__header">基本信息</div>
    <el-form ref="form" :model="form" label-width="150px" style='margin-top: 20px;'>
      <el-row>
        <el-col :span="12">
          <el-form-item label="组织名称" prop="name">
            <el-input disabled
                      v-model="form.name"
                      placeholder="组织名称"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="分类" prop="category">
            <el-select v-model="form.category" disabled placeholder="请选择" style="width:100%">
              <el-option label="企业" :value="1"/>
<!--              <el-option label="部门" :value="2"/>-->
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
<!--          <el-form-item label="经营状态" prop="status">-->
          <el-form-item label="状态" prop="status">
            <el-select v-model="form.status" disabled placeholder="请选择" style="width:100%">
              <el-option label="存续" :value="1"/>
              <el-option label="注销" :value="2"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="组织类型" prop="type">
            <el-select v-model="form.type" disabled placeholder="请选择" style="width:100%">
              <el-option label="外部" :value="0"/>
              <el-option label="内部" :value="1"/>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="证件类型" prop="idType">
            <el-select v-model="form.idType" disabled placeholder="请选择" style="width:100%">
              <el-option label="统一社会信用代码" :value="1"/>
              <el-option label="身份证" :value="2"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="证件号码" prop="idNo">
            <el-input v-model="form.idNo" disabled placeholder="请输入"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="组织编码" prop="account">
            <el-input v-model="form.account" disabled placeholder="请输入"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="联系地址" prop="contractAddress">
            <el-input v-model="form.contractAddress" disabled placeholder="请输入"/>
          </el-form-item>
        </el-col>
      </el-row>
      <!-- <div class="dialog__header" style="margin-bottom:16px;">三方系统账号</div>
      <el-row>
        <el-col :span="12">
          <el-form-item label="实名状态" prop="status">
            <el-select style="width: 100%" v-model="form.realNameStatus" disabled placeholder="请选择">
              <el-option label="未实名 " :value="0"/>
              <el-option label="已实名 " :value="1"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="5G随意签SaaS账号" prop="status">
            <el-input disabled
                      v-model="form.saasAccountG5"
                      placeholder=""
            />
          </el-form-item>
        </el-col>
      </el-row> -->
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="cancel">关 闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
let defaultForm = {
  name: '',
  category: 1,
  status: "1",
  type: 0,
  idType: "1",
  idNo: "",
  contractAddress: "",
  realNameStatus:'',
  saasAccountG5: ""
}
export default {
  components: {},
  data() {
    return {
      form: JSON.parse(JSON.stringify(defaultForm)),
      open: false,
      idRule: []
    };
  },
  methods: {
    show(row) {
      // console.log('row',row)
      this.open = true;
      this.form = Object.assign(this.form, row)
      this.form.category = 1;
      this.form.type = 0;
    },
    // 取消按钮
    cancel() {
      this.open = false;
    },
    /** 重置按钮操作 */
    resetForm() {
      this.form = JSON.parse(JSON.stringify(defaultForm))
    },
  },
};
</script>
<style lang="less" scoped>
.dialog__header {
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc;
  font-size: 14px !important;
  font-weight: bold;
  color: #000;
}
</style>
